<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMiniProgramTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('mini_program_templates', function (Blueprint $table) {
            $table->increments('id')->commont('表备注：本地微信模板信息表id');
            $table->string('name')->commont('名称');
            $table->integer('app_project_type_id')->default(0)->comment('项目类型id');
            $table->string('wx_template_id')->default('')->comment('微信模板id');
            $table->string('images', 1200)->default('[]')->comment('展示图片,json存储配图列表url，最多6张');
            $table->json('ext_json')->comment('小程序的自定义配置模板json格式');
            $table->string('remark')->default('')->comment('备注');
            $table->dateTime('wx_created_at')->nullable()->default(null)->comment('微信模板创建时间');
            $table->string('wx_user_version')->default('')->comment('微信模版版本号');
            $table->string('wx_user_desc')->default('')->comment('微信模版描述');
            $table->string('wx_developer')->default('')->comment('微信开发者');
            $table->json('server_domain')->comment('小程序的设置服务器域名');
            $table->json('webviewdomain')->comment('小程序的设置业务域名');
            $table->json('wx_submit_audit_item_list')->comment('审核项列表');

            $table->dateTime('created_at')->nullable()->default(null);
            $table->dateTime('updated_at')->nullable()->default(null);
            $table->tinyInteger('deleted')->default(0)->comment('是否删除,1:是,0:否');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('mini_program_templates');
    }
}
